// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

mod common;
mod db;
mod error;
mod gitcode;
mod news;

use crate::db::init_db;
use news::{get_news_from_weibo_hot, update_weibo};

#[tokio::main]
async fn main() {
    env_logger::init();
    log::info!("init database.......");
    init_db().await.unwrap();
    tauri::Builder::default()
        .invoke_handler(tauri::generate_handler![
            get_news_from_weibo_hot,
            update_weibo,
            get_report
        ])
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}
